<template>
  <div>
    <p>{{time}}</p>
    <button @click="getDate">点击查看我活了多少天?</button>
  </div>
</template>

<script>

export default {
  data () {
    return {
      time:0
    }
  },
  methods: {
    getDate(){
   let data1=new Date()
   let data2=new Date('1997-06-19')
   let data3=data1-data2
   let day= parseInt(data3 / (1000 * 60 * 60 * 24));
   this.time=day
    }
  }
  }

function day(){
   
}
 day()
</script>

<style>

</style>